package com.project.application.framework.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author :levnli
 */
@Component
@ConfigurationProperties(prefix = "app")
public class AppConfig {

    private static String name;
    private static String description;
    private static String author;
    private static String url;
    private static String email;
    private static String version;

    public static String getName() {
        return name;
    }

    public void setName(String name) {
        AppConfig.name = name;
    }

    public static String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        AppConfig.description = description;
    }

    public static String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        AppConfig.author = author;
    }

    public static String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        AppConfig.url = url;
    }

    public static String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        AppConfig.email = email;
    }

    public static String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        AppConfig.version = version;
    }

    /**
     * 上传路径
     */
    private static String profile;

    private static Boolean captcha;

    public static String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        AppConfig.profile = profile;
    }

    public static Boolean getCaptcha() {
        return captcha;
    }

    public void setCaptcha(Boolean captcha) {
        AppConfig.captcha = captcha;
    }

    /**
     * 获取导入上传路径
     */
    public static String getImportPath() {
        return getProfile() + "/import";
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath() {
        return getProfile() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath() {
        return getProfile() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath() {
        return getProfile() + "/upload";
    }
}
